<template>
  <view class="contain">
    <view class="adver more">
      <u-swiper
        :list="bannerList"
        @click="changeSwiperHandle"
        mode="dot"
        img-mode="scaleToFill"
        height="152"
        border-radius="8"
      ></u-swiper>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    bannerList: {
      type: Array,
      default: () => [
        {
          image: "../../static/img/belowbanner.png",
          title: "公司注册",
          url: "/pageTwo/financialService/register/register",
          inside: true,
        },
        {
          image: "../../static/img/belowbanner01.png",
          title: "差旅管家",
          url: "/pageTwo/officeService/administrative/index",
          inside: true,
        },
        {
          image: "../../static/img/belowbanner02.png",
          title: "资质代办",
          url: "/pageTwo/financialService/keepAccount/keepAccount",
          inside: true,
        },
      ],
    },
  },
  data() {
    return {};
  },
  methods: {
    changeSwiperHandle(e) {
      var pathUrl = this.bannerList[e].url;
      if (this.bannerList[e].inside) {
        uni.navigateTo({
          url: "../.." + pathUrl,
        });
      } else {
        // #ifdef  H5
        window.location.href = pathUrl;
        // #endif

        // #ifdef  APP-PLUS
        plus.runtime.openURL(pathUrl);
        // #endif
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.contain {
  .adver {
    margin-bottom: 30rpx;
    margin-top: 30rpx;
    image {
      width: 690rpx;
      height: 152rpx;
    }
  }
  .more {
    padding-left: 30rpx;
    padding-right: 30rpx;
  }
}
</style>
